<template>
	<view>
		<uni-card>
			<!-- #ifdef APP || H5 -->
			<text class="uni-body view-content" v-html="info.content"></text>
			<!-- #endif -->
			<!-- #ifdef MP-WEIXIN -->
			<rich-text :nodes="info.content"></rich-text>
			<!-- #endif -->
			<view>
				<u-album :urls="urls" :row-count="4"></u-album>
			</view>
			<view style="display: flex;justify-content: space-between; margin-top: 3%;">
				<view>浏览次数:{{info.viewCount}}</view>
				<view>更新时间:{{info.updateTime}}</view>
			</view>

		</uni-card>
		<uni-card class="view-title2" title="联系方式">
			<view class="uni-body view-content">
				微信: {{info.weixin}}
			</view>
			<view class="uni-body view-content">
				QQ: {{info.qq}}
			</view>
			<view class="uni-body view-content">
				联系电话: {{info.phone}}
			</view>
		</uni-card>
	</view>
</template>

<script>
	import {
		getInfo
	} from "@/api/info/info"
	export default {
		data() {
			return {
				info: {},
				content: "",
				urls: [],
			}
		},
		onLoad(options) {
			getInfo(options.infoId).then(res => {
				this.info = res.data

				if (this.info.photos) {

					this.urls = []
					const formattedUrls = this.info.photos.split(',').map(url => url.trim());
					this.urls = formattedUrls

				}

				uni.setNavigationBarTitle({
					title: res.data.type
				})
			});
		},
		method: {
			getContent() {
				console.info(this.info.content)
				return this.info.content
			},
		}
	}
</script>

<style scoped>
	page {
		background-color: #ffffff;
	}

	.view-title {
		font-weight: bold;
		color: palevioletred;
	}


	.view-content {
		font-size: 26rpx;
		padding: 12px 5px 0;
		color: #333;
		line-height: 24px;
		font-weight: normal;
	}
</style>